/* Prompt section styles */
.prompt-section {
  background: var(--bg);
  /* Fallback */
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.03) 0%, var(--bg) 70%);
  padding: 80px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

[data-theme="light"] .prompt-section {
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.08) 0%, #ffffff 70%);
}

.prompt-container {
  width: 100%;
  max-width: 900px;
  text-align: center;
  color: var(--text);
}

.prompt-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  position: relative;
  display: inline-block;
}

.prompt-title::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 3px;
  background: var(--accent);
  bottom: -15px;
  left: 20%;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent);
}

[data-theme="light"] .prompt-title {
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}

/* Subtitle */
.prompt-subtitle {
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 40px;
  font-size: 1.1rem;
}

/* Prompt input box */
.prompt-box {
  display: flex;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.08);
  transition: 0.3s;
}

[data-theme="light"] .prompt-box {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.prompt-box:hover {
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.15);
}

[data-theme="light"] .prompt-box:hover {
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

/* TEXTAREA */
.prompt-box textarea {
  flex: 1;
  padding: 16px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  resize: none;
  overflow-y: auto;
  max-height: 250px;
  min-height: 50px;
  line-height: 1.5;
}

.prompt-box textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* GENERATE BUTTON */
.prompt-box button {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  color: #000;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  padding: 12px 28px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prompt-box button:hover {
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
}

/* OUTPUT BOX */
.output-box {
  margin-top: 40px;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: left;
  color: var(--text);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.05);
  transition: 0.3s;
}

[data-theme="light"] .output-box {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.output-box:hover {
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.15);
}

[data-theme="light"] .output-box:hover {
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.output-header h3 {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  font-size: 1.2rem;
}

#outputText {
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* COPY/RESET BUTTONS */
.output-header button {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  color: #000;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.output-header button:hover {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  transform: translateY(-2px);
}

/* GHOST BUTTONS */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.25s ease;
  backdrop-filter: blur(4px);
}

[data-theme="light"] .ghost-btn {
  border-color: rgba(0, 0, 0, 0.35);
  color: #000;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

/* DISABLED */
.ghost-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Tone Selector */
.tone-box {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  color: var(--text);
  font-size: 1rem;
}

.tone-box label {
  font-weight: 600;
  color: var(--accent);
}

.tone-box select {
  background-color: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.3s ease;
}

/* Word Counter FIX */
.counter-box {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  opacity: 0.85;
}

.counter-box span {
  color: var(--text-muted);
}

/* =========================================
   RESPONSIVE DESIGN – MOBILE OPTIMIZATION
   ========================================= */

/* For screens below 768px (Tablets + Mobiles) */
@media (max-width: 768px) {

  .prompt-section {
    padding: 60px 15px;
  }

  .prompt-title {
    font-size: 2.2rem;
  }

  .prompt-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  /* Stack textarea + button */
  .prompt-box {
    flex-direction: column;
  }

  .prompt-box textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px;
    font-size: 1rem;
  }

  .prompt-box button {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1.05rem;
  }

  /* Output box spacing */
  .output-box {
    padding: 16px;
  }

  /* Output header — stack on mobile */
  .output-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .output-header h3 {
    font-size: 1.1rem;
  }

  .output-header button {
    width: 100%;
    text-align: center;
  }

  /* Action buttons wrap cleanly */
  .action-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .ghost-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  /* Tone selector — stack */
  .tone-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .tone-box select {
    width: 100%;
    padding: 12px;
  }

  /* Counter alignment */
  .counter-box {
    font-size: 0.85rem;
  }
}

/* Extra small screens below 480px */
@media screen and (max-width: 480px) {
  .prompt-section {
    padding: 40px 20px !important;
    /* Consistent with Hero/Footer */
  }

  .prompt-container {
    width: 100%;
    padding: 0;
  }

  .prompt-title {
    font-size: 2rem !important;
    /* Prevent header from being too huge */
    line-height: 1.3;
    margin-bottom: 10px;
  }

  .prompt-subtitle {
    font-size: 0.9rem !important;
    padding: 0 10px;
    /* Prevent text touching edges */
  }

  .prompt-box textarea {
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    padding: 15px;
  }

  .prompt-box button {
    font-size: 1rem;
    padding: 12px;
  }

  .output-box {
    padding: 20px 15px;
  }

  .template-box,
  .tone-box {
    display: flex;
    flex-direction: column;
    /* Stack Label, Select, and Buttons vertically */
    align-items: stretch;
    /* Make them full width */
    gap: 10px;
    margin-bottom: 20px;
  }

  .template-box select,
  .tone-box select {
    width: 100%;
    /* Full width dropdowns are easier to tap */
    margin-right: 0;
  }

  .template-box button {
    width: 100%;
    margin-top: 5px;
  }

  #generateBtn {
    width: 100%;
    /* Full width "Generate" button */
    padding: 14px;
    font-size: 1.1rem;
  }

  .action-buttons {
    display: flex;
    flex-wrap: wrap;
    /* Allow buttons to wrap to next line */
    gap: 10px;
    justify-content: center;
  }

  .action-buttons .ghost-btn {
    flex: 1 1 auto;
    /* Buttons grow to fill space */
    min-width: 100px;
    /* Minimum touch target size */
    font-size: 0.9rem;
  }

  .wizard-card {
    width: 95% !important;
    /* Fit within screen */
    max-height: 90vh;
    /* Prevent being taller than screen */
    overflow-y: auto;
    /* Scroll inside modal if content is long */
    padding: 20px;
    margin: 10px auto;
  }

  .wizard-footer {
    flex-direction: column-reverse;
    /* Stack buttons, "Back" on bottom */
    gap: 10px;
  }

  .wizard-footer button {
    width: 100%;
  }
}

/* ================================
   TEMPLATE SELECTOR UI
   ================================ */

.template-box {
  margin-top: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  color: var(--text);
  font-size: 1rem;
}

.template-box {
  margin-top: 25px;
  margin-bottom: 18px;
  /* ⭐ Add this gap */
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  color: var(--text);
  font-size: 1rem;
}


.template-box label {
  font-weight: 600;
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
}

.template-box select {
  background-color: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.3s ease;
  outline: none;
}

.template-box select:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

/* Save Template Button style match with ghost-btn */
#saveTemplateBtn {
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.25s ease;
}

#saveTemplateBtn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

[data-theme="light"] #saveTemplateBtn {
  border-color: rgba(0, 0, 0, 0.35);
  color: #000;
}

/* Mobile responsive - Template box */
@media (max-width: 768px) {
  .template-box {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .template-box select {
    width: 100%;
  }

  #saveTemplateBtn {
    width: 100%;
    justify-content: center;
  }

  .template-box {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 15px;
    /* ⭐ Mobile gap */
  }

}

/* ================================
   WIZARD MODAL (Option C)
   ================================ */

.wizard-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2000;
  padding: 20px;
}

.wizard-modal[aria-hidden="false"] {
  display: flex;
}

/* Wizard Card */
.wizard-card {
  width: 100%;
  max-width: 750px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
}

/* Header */
.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wizard-header h3 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  font-size: 1.1rem;
}

#closeWizardBtn {
  font-size: 0.9rem;
}

/* Body */
.wizard-body {
  padding: 18px;
}

.wizard-step-wrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 160px;
}

/* Step Form */
.wizard-step label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.wizard-step input,
.wizard-step textarea,
.wizard-step select {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}

.wizard-step textarea {
  resize: vertical;
}

/* Optional text */
.wizard-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Footer */
.wizard-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Progress text */
.wizard-progress {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .wizard-card {
    max-width: 100%;
  }

  .wizard-header,
  .wizard-footer {
    padding: 12px;
  }

  .wizard-body {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .wizard-header h3 {
    font-size: 1rem;
  }

  .wizard-step input,
  .wizard-step textarea {
    font-size: 0.9rem;
  }
}

/* ==========================
   Tone + Length Selector
========================== */

.tone-box {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-start;
}

.tone-item,
.length-item,
.language-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tone-item label,
.length-item label,
.language-item label {
  font-weight: 600;
  color: var(--accent);
}

.tone-item select,
.length-item select {
  background-color: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {

  /* Tone selector — stack */
  .tone-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Make each item (Label + Select) a row */
  .tone-item,
  .length-item,
  .language-item {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .tone-item select,
  .length-item select,
  .language-item select {
    width: 60%;
  }
}

/* ⭐ LANGUAGE SELECTOR — perfectly match tone/length */
#languageSelect {
  background-color: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.3s ease;
}

#languageSelect:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}